Skip to content

bash_guard blocks cat heredoc even for a new file - #46

Merged
github-actions[bot] merged 1 commit into
mainfrom
improve/F-2-bash-guard-blocks-cat-heredoc-even-for-a
Nov 11, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
improve/F-2-bash-guard-blocks-cat-heredoc-even-for-a

Conversation

@zolotarev

Copy link
Copy Markdown
Owner

Friction — bash_guard blocks cat heredoc even for a new file

Seen ×23 in 17 task(s) of one project.

лишний круг у каждого исполнителя при создании и правке файлов

Change

  • bash_guard blocks cat heredoc even for a new file

Sent by dpcli contribute. Anonymized: no project names, paths or quotes.

@github-actions

Copy link
Copy Markdown

VERDICT: accept

  • Real friction: 23 reports in 17 tasks, and the retry cost is real. Allowing cat > file << for a path that doesn't exist is a small, well-scoped change. Overwriting or appending to an existing file is still blocked.
  • Tested: test_cat_heredoc_blocks_existing_files_only covers both > and >> on an existing file, plus the new-file pass. The removed cat > src/x.ts case from the old block list is covered there. I did not run the suite myself.
  • Process is fine: VERSION is bumped to 47, there is a CHANGELOG line, and it is English and anonymized. The hint text only grows by a few tokens.
  • Nit, lib/dpcli/__init__.py:9: VERSION = 47# bump… lost the space before #. Restore 47 #.
  • Nit, hooks/bash_guard.py:52: os.path.exists(target) resolves against the hook's cwd, and it doesn't expand ~ or $VAR. So cd sub && cat > existing << and cat > ~/x << now pass as "new". The guard is advisory, so this is acceptable. A future tweak could treat targets containing $ or ~ as existing.
  • Nit, hooks/bash_guard.py:52: os is imported alongside subprocess, which is fine. The what == "cat > file <<" string compare is a bit brittle; consider a flag in the SHELL tuple.

@github-actions
github-actions Bot merged commit f2e2d60 into main Nov 11, 2026
3 checks passed
@github-actions
github-actions Bot deleted the improve/F-2-bash-guard-blocks-cat-heredoc-even-for-a branch November 11, 2026 22:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feedback Friction reported from real use

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant